package com.example.module_orders.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.module_orders.R

class AddOrdersImageAdapter : BaseQuickAdapter<String,BaseViewHolder>(R.layout.add_orders_image_item) {
    override fun convert(holder: BaseViewHolder, item: String) {
        if (item == "+") {
            holder.setImageResource(R.id.item_add_orders_img_iv, R.drawable.baseline_add)
                .setBackgroundResource(R.id.item_add_orders_img_iv,R.drawable.add_orders_image_bg)

        } else {
            Glide.with(context).load(item).into(holder.getView(R.id.item_add_orders_img_iv))

        }
    }
}